package com.open.capacity.forum.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.open.capacity.common.exception.service.ServiceException;
import com.open.capacity.common.web.PageResult;
import com.open.capacity.common.web.Result;
import com.open.capacity.forum.model.Comment;
import com.open.capacity.forum.model.CommentPraise;

import java.util.Map;

public interface CommentService extends IService<Comment> {

    /**
     * 根据评论类型查询评论
     * @param CommentType 评论类型 - 文章 | 资源
     * @param params 查询条件
     * @return
     */
    PageResult findCommnet(Integer CommentType, Map<String, Object> params) throws ServiceException;

    /**
     * 评论提交
     * @param CommentType 评论类型 - 文章 | 资源
     * @param comment 评论实体
     * @return 插入成功的评论dto
     * @throws ServiceException
     */
    Result commentSubmit(Integer CommentType, Comment comment) throws ServiceException;

    /**
     * 评论点赞
     * @param commentPraise
     * @return
     * @throws ServiceException
     */
    Result commentPraise(CommentPraise commentPraise) throws ServiceException;

}
